//
//  CarViewModel.m
//  Park
//
//  Created by 123456 on 2017/11/4.
//  Copyright © 2017年 YTYangK. All rights reserved.
//

#import "CarViewModel.h"

@implementation CarViewModel


+(void)requestWithUrlForReserve:(id)obj andParam:(NSDictionary *)param success:(void(^)(NSString *model))success failure:(void(^)(NSString *error))failure{
    
    
    [NetRequestClss requestWithUrl:@"app/reserve.do?" requestWithParameters:param method:NetMethodPOST returnSuccess:^(id objs, int status, NSString *mag) {
        
        NSLog(@"请求返回 ===== %@",objs);
        
        if ([objs[@"result"] isEqualToString:@"success"]) {
                
                success(objs[@"msg"]);
        }else{
            failure(objs[@"msg"]);
        }
    } returnError:^(NSString *err) {
        failure(err);
    }];
}

+(void)requestWithUrlForTimer:(id)obj andParam:(NSDictionary *)param success:(void(^)(NSMutableArray *model))success failure:(void(^)(NSString *error))failure{
    
    [NetRequestClss requestWithUrl:@"/app/findscheduledById.do?" requestWithParameters:param method:NetMethodGET returnSuccess:^(id objs, int status, NSString *mag) {
        
        NSLog(@"请求返回 ===== %@",objs);
        
        
        if ([objs[@"result"] isEqualToString:@"success"]) {
            success(objs[@"body"][@"scheduledTimeDP"]);
            
        }else{
            failure(objs[@"msg"]);
            
        }        
    } returnError:^(NSString *err) {
        failure(err);
        
    }];
    
    
    
}





@end
